package com.adams.access.db.bean;

import java.io.Serializable;

import javax.persistence.Column;

/**
 * 
 * 
 * File Name : DicColumnPK.java
 * 
 * @Description : 联合主键
 */
public class ParameterPK implements Serializable
{
	private static final long serialVersionUID = 1L;

	private String parameterName; // 参数名

	private String parameterType; // 参数类型

	public ParameterPK()
	{
		super();
	}

	@Column(length = 64, nullable = false)
	public String getParameterName()
	{
		return parameterName;
	}

	public void setParameterName(String parameterName)
	{
		this.parameterName = parameterName;
	}

	@Column(length = 64, nullable = false)
	public String getParameterType()
	{
		return parameterType;
	}

	public void setParameterType(String parameterType)
	{
		this.parameterType = parameterType;
	}

	public ParameterPK(String parameterName, String parameterType)
	{
		super();
		this.parameterName = parameterName;
		this.parameterType = parameterType;
	}

	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((parameterType == null) ? 0 : parameterType.hashCode());
		result = prime * result
				+ ((parameterName == null) ? 0 : parameterName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ParameterPK other = (ParameterPK) obj;
		if (parameterType == null)
		{
			if (other.parameterType != null)
				return false;
		} else if (!parameterType.equals(other.parameterType))
			return false;
		if (parameterName == null)
		{
			if (other.parameterName != null)
				return false;
		} else if (!parameterName.equals(other.parameterName))
			return false;
		return true;
	}

}
